In [1]:
import cv2
In [2]:
import matplotlib.pyplot as plt
In [3]:
img = cv2.imread('rgbimage.png')
In [4]:
img_RGB = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
In [5]:
plt.imshow(img_RGB)
Out[5]:
In [6]:
plt.show()
In [7]:
print('Image shape:', img_RGB.shape)
In [8]:
plt.figure(figsize=(10,6))
Out[8]:
In [9]:
plt.subplot(1,3,1)
Out[9]:
In [10]:
plt.title('Red Plane')
Out[10]:
In [11]:
plt.imshow(img_RGB[:,:,0])
Out[11]:
In [12]:
plt.subplot(1,3,2)
Out[12]:
In [13]:
plt.title('Green Plane')
Out[13]:
In [14]:
plt.imshow(img_RGB[:,:,1])
Out[14]:
In [15]:
plt.subplot(1,3,3)
Out[15]:
In [16]:
plt.title('Blue Plane')
Out[16]:
In [17]:
plt.imshow(img_RGB[:,:,2])
Out[17]:
In [18]:
plt.show()